package model

import "errors"

var ErrNotFound = errors.New("Rows selectd is zero")
var ErrNotUpdated = errors.New("Rows affected by update is zero")
var ErrNotDeleted = errors.New("Rows affected by delete is zero")

var IsConstraintError = errors.New("Constraint failed")
var IsValidationError = errors.New("Validation failed")
var IsNotSingular = errors.New("Name is not singular")

type SysFreightTemplateRel struct {
	Restrictions      []*SysFreightTemplateRestriction `json:"restrictions"`
	Rules             []*SysFreightTemplateRule        `json:"rules"`
	DelRestrictionIds []uint64                         `json:"delRestrictionIds"`
	DelRuleIds        []uint64                         `json:"delRuleIds"`
}

type SysMemberRankRel struct {
	Restrictions      []*SysMemberRankRestriction `json:"restrictions"`
	Rules             []*SysMemberRankRule        `json:"rules"`
	DelRestrictionIds []uint64                    `json:"delRestrictionIds"`
	DelRuleIds        []uint64                    `json:"delRuleIds"`
}

type TreeNode struct {
	Name     string      `json:"title,optional"`
	Code     string      `json:"key"`
	IsLeaf   *uint32     `json:"isLeaf,optional,omitempty"`
	Children []*TreeNode `json:"children,optional,omitempty"`
}
